package com.zwj.interview;

/**
 * @Author: Zwj
 * @Date: 2022/2/28 11:11
 */
public class 环形数组 {

    public static void main(String[] args) {
        int[] arr={1,2,3,4,5};
        int n=arr.length;
        int index=0;
        while(true){
            System.out.println(arr[index]);
            index=(index+1)%n;
        }
    }
}